package edu.mtu.citizenscience.streamapplication.activity.main;

import android.annotation.SuppressLint;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
 
public class SpinnerOnItemSelectedListener implements OnItemSelectedListener {
	
	private View v;
	private String s;
	
  public void loadView(View view, String str){
	  v = view;
	  s = str;
  }
	
  @SuppressLint("NewApi")
public void onItemSelected(AdapterView<?> parent, View view, int pos,long id) {
		if(parent.getItemAtPosition(pos).toString().equals(s)){
			v.setEnabled(true);
		}
		else{
			v.setEnabled(false);
		}
  }
 
  @Override
  public void onNothingSelected(AdapterView<?> arg0) {
	// TODO Auto-generated method stub
  }
 
}
